<script setup lang="ts">
import { images_common } from '@/utils/common/utils.ts';
import PortalButton from '@/components/form/button/PortalButton.vue';
import { userPay } from '@/api/pay/index.ts';
import { ref } from 'vue';
const { query, openPay, dialogVisible, bak, userInfo } = userPay();
const sfzh = ref<string>('');
</script>
<template>
  <div class="layout-mobile-body" :style="bak">
    <div class="layout-gz-query-body">
      <div class="layout-gz-image">
        <img :src="images_common('logo_bg.png')" alt="logo" />
      </div>
      <span>学生在线缴费</span>
    </div>
    <div class="layout-gz-body">
      <div class="query-body">
        <div class="query-content">
          <input v-model="sfzh" placeholder="请输入您的身份证号码" />
          <div class="query-button" @click.stop="query(sfzh)">
            <svg-icon name="icon-svg-search"> </svg-icon>
          </div>
        </div>
      </div>
    </div>
    <div class="layout-gz-footer">
      <div class="layout-gz-footer-body">
        地址：贵州省贵阳市云岩区白云大道224号 传真：0851-84859207 邮政编码：550008<br />
        © 贵州交通技师学院 - 黔ICP备20003500号 贵公网安备52010302001852号 建议：使用IE10以上、Chrome或Firefox等浏览器
      </div>
    </div>
  </div>
  <el-dialog v-model="dialogVisible" :fullscreen="true" :show-close="false" draggable>
    <template #header="{ close }">
      <div class="my-header">
        <div class="my-header-title">缴费详情</div>
        <div class="my-header-button" @click="close"><svg-icon name="icon-com-close" /></div>
      </div>
    </template>
    <div class="my-layout-body">
      <div class="my-body">
        <div class="my-body-li">
          <div class="li-title">姓名：</div>
          <div class="li-span">{{ userInfo.xm }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">性别：</div>
          <div class="li-span">{{ userInfo.xb }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">身份证件号：</div>
          <div class="li-span">{{ userInfo.sfzjh }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">手机号码：</div>
          <div class="li-span">{{ userInfo.sjhm }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">单位名称：</div>
          <div class="li-span">{{ userInfo.dwmc }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">批次名称：</div>
          <div class="li-span">{{ userInfo.pcmc }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">职业工种：</div>
          <div class="li-span">{{ userInfo.zymc }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">缴费金额：</div>
          <div class="li-span">{{ userInfo.jfje }}</div>
        </div>
        <div class="my-body-li">
          <div class="li-title">缴费状态：</div>
          <div v-if="userInfo.zt === '2'" class="li-span">已支付</div>
          <div v-else class="li-span">未支付</div>
        </div>
        <div class="my-body-button">
          <portal-button v-if="userInfo.zt !== '2'" theme="primary" @click="openPay(sfzh)">立即缴费</portal-button>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<style scoped lang="scss">
.layout-mobile-body {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-flow: column nowrap;
  .layout-gz-query-body {
    width: 100%;
    height: 80px;
    padding: 15px 10px;
    box-sizing: border-box;
    display: flex;
    flex-flow: row nowrap;
    background-color: rgba(255, 255, 255, 0.4);
    align-items: center;
    .layout-gz-image {
      height: 100%;
      img {
        height: 100%;
      }
    }
    span {
      padding-left: 10px;
      font-size: 1.6rem;
      font-weight: bold;
      letter-spacing: 2px;
      color: #096b88;
    }
  }
  .layout-gz-body {
    flex: 1 1;
    position: relative;
    padding: 0 20px;
    .query-body {
      width: 100%;
      height: 90px;
      background-color: #eeeeee;
      border-radius: 6px;
      margin-top: 100px;
      box-shadow: 0 0 12px rgba(0, 0, 0, 0.12);
      padding: 20px 15px;
      box-sizing: border-box;
      .query-content {
        width: 100%;
        height: 100%;
        border-radius: 25px;
        background-color: #ffffff;
        padding-left: 30px;
        padding-right: 30px;
        line-height: 50px;
        position: relative;
        input {
          background: none;
          outline: none;
          border: 0;
          display: block;
          width: 100%;
          height: 100%;
          font-size: 1.1rem;
        }
        .query-button {
          position: absolute;
          width: 50px;
          height: 50px;
          top: 0;
          right: 10px;
          text-align: center;
          line-height: 50px;
          font-size: 2rem;
          cursor: pointer;
        }
      }
    }
  }
  .layout-gz-footer {
    height: 100px;
    padding: 10px;
    .layout-gz-footer-body {
      width: 100%;
      text-align: center;
      line-height: 20px;
      font-size: 0.9rem;
      color: #eeeeee;
      font-weight: 600;
    }
  }
}
.my-header {
  width: 100%;
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  border-bottom: 1px solid #dcdfe6;
  font-size: 1.2rem;
  font-weight: bold;
  .my-header-title {
    position: relative;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .my-header-title:before {
    content: '';
    position: absolute;
    width: 3px;
    height: 20px;
    top: 2px;
    left: 0;
    background-color: #1b8afa;
  }
  .my-header-button {
    width: 50px;
    height: 50px;
    text-align: right;
    line-height: 50px;
    cursor: pointer;
  }
  .my-header-button:hover {
    svg {
      fill: #1b8afa;
    }
  }
}
.my-layout-body {
  height: 74vh;
  width: 100%;
  padding: 20px 0;
  box-sizing: border-box;
  .my-body {
    width: 100%;
    height: 100%;
    border: 1px solid #dcdfe6;
    border-radius: 5px;
    .my-body-li {
      width: 100%;
      height: 50px;
      display: flex;
      flex-flow: row nowrap;
      align-items: center;
      border-bottom: 1px solid #dcdfe6;
      .li-title {
        width: 120px;
        padding: 0 10px;
        text-align: center;
        font-weight: bold;
        font-size: 1.1rem;
        height: 100%;
        line-height: 50px;
        background-color: #e4e4e4;
      }
      .li-span {
        flex: 1 1;
        padding: 0 10px;
        text-align: left;
        color: #096b88;
        overflow: hidden;
      }
    }
    .my-body-button {
      margin-top: 20px;
      width: 100%;
      height: 50px;
      text-align: center;
      padding: 5px 30%;
    }
  }
}
.my-erm-body {
  width: 100%;
  height: 300px;
}
</style>
